

#ifndef MEDIACODEC_VIDEO_DECODER_H
#define MEDIACODEC_VIDEO_DECODER_H


#include "media/NdkMediaCodec.h"
#include "media/NdkMediaFormat.h"

#include "video_common_define.h"
#include "video_decoder.h"



namespace mydecoder
{
    
class MediacodecVideoDecoder : public VideoDecoder
{
private:
    VideoCodecInfo *m_codecInfo;
    AMediaCodec *m_mediaCodec;
    AMediaFormat *m_mediaFormat;

private:
    VideoCodecError initMediaCodec();
    void releaseMediaCodec();
    VideoCodecError initMediaFormat();
    void releaseMediaformat();


public:
    MediacodecVideoDecoder();
    ~MediacodecVideoDecoder();

    VideoCodecError init(const AVBuffer *buffer) override;
    VideoCodecError decode() override;

};


} // namespace mydecoder



#endif